package com.skytech.tax.customsdatawarehouse.electronicport.customsdeclarations.domain.entity;

import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang.StringUtils;

/**
 * @author Lianhong
 * @since 2021/6/10
 */
public class ElectronicPortCustomsDeclaration {

    private String entryId;                 //出口报关单号
    private JSONObject customsDeclaration;  //进出口报关单详细信息
    private String socialCreditCode;        //企业社会信用代码

    private String decType;
    private String flagDec;
    private String opMode;

    public String getEntryId() {
        return entryId;
    }

    public void setEntryId(String entryId) {
        this.entryId = entryId;
    }

    public String getSocialCreditCode() {
        return socialCreditCode;
    }

    public void setSocialCreditCode(String socialCreditCode) {
        this.socialCreditCode = socialCreditCode;
    }

    public JSONObject getCustomsDeclaration() {
        return customsDeclaration;
    }

    public void setCustomsDeclaration(JSONObject customsDeclaration) {
        this.customsDeclaration = customsDeclaration;
    }


    public String getDecType() {
        return decType;
    }

    public void setDecType(String decType) {
        this.decType = decType;
    }

    public String getFlagDec() {
        return flagDec;
    }

    public void setFlagDec(String flagDec) {
        this.flagDec = flagDec;
    }

    public String getOpMode() {
        return opMode;
    }

    public void setOpMode(String opMode) {
        this.opMode = opMode;
    }

    public CustomsDeclaration buildCustomsDeclaration() {
        if (StringUtils.isEmpty(this.entryId) || this.customsDeclaration == null) return null;
        return new CustomsDeclaration(this.entryId, this.socialCreditCode, this.customsDeclaration, this.decType, this.flagDec, this.opMode);
    }

    public CustomsDeclarationSimple buildCustomsDeclarationSimple(String iEDate) {
        if (StringUtils.isEmpty(entryId)) return null;
        return new CustomsDeclarationSimple(entryId, iEDate);
    }
}
